//
//  ZGLAboutSecondTVC.m
//  Faker
//
//  Created by dllo on 15/11/9.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "ZGLAboutSecondTVC.h"
#import <MessageUI/MessageUI.h>


@interface ZGLAboutSecondTVC ()<MFMailComposeViewControllerDelegate>
@property (nonatomic, strong) UIButton *numButton;
@property (nonatomic, strong) UIButton *addressButton;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIWebView *webView;
@end


@implementation ZGLAboutSecondTVC

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.titleLabel = [[UILabel alloc] init];
        self.numButton = [UIButton buttonWithType:UIButtonTypeSystem];
        self.emailButton = [UIButton buttonWithType:UIButtonTypeSystem];
        self.addressButton = [UIButton buttonWithType:UIButtonTypeSystem];
        [self.contentView addSubview:self.titleLabel];
        [self.contentView addSubview:self.numButton];
        [self.contentView addSubview:self.emailButton];
        [self.contentView addSubview:self.addressButton];
    }
    return self;
}

-(void)layoutSubviews {
    [super layoutSubviews];
    self.titleLabel.frame = CGRectMake(40 * ScaleX, 30 * ScaleX, 100 * ScaleX , 30 * ScaleX);
    self.titleLabel.text = @"联系我们";
    self.titleLabel.textColor = [UIColor colorWithRed:0.137 green:0.119 blue:0.173 alpha:1.000];
    [self.numButton setFrame:CGRectMake(40 * ScaleX, 65 * ScaleX, 295 * ScaleX, 30 * ScaleX)];
    self.numButton.layer.cornerRadius = 6;
    self.numButton.layer.masksToBounds = YES;
    [self.numButton setTitleColor:[UIColor colorWithWhite:0.417 alpha:1.000] forState:UIControlStateNormal];
    self.numButton.layer.borderWidth = 0.3;
    self.numButton.layer.borderColor = [UIColor colorWithWhite:0.451 alpha:1.000].CGColor;
    [self.numButton setTitle:@"15214593480" forState:UIControlStateNormal];
    [self.numButton addTarget:self action:@selector(call) forControlEvents:UIControlEventTouchUpInside];
    [self.emailButton setFrame:CGRectMake(40 * ScaleX, 100 * ScaleX, 295 * ScaleX, 30 * ScaleX)];
    self.emailButton.layer.cornerRadius = 6;
    self.emailButton.layer.masksToBounds = YES;
    [self.emailButton setTitleColor:[UIColor colorWithWhite:0.417 alpha:1.000] forState:UIControlStateNormal];
    self.emailButton.layer.borderWidth = 0.3;
    self.emailButton.layer.borderColor = [UIColor colorWithWhite:0.451 alpha:1.000].CGColor;
    [self.emailButton setTitle:@"15214593480@163.com" forState:UIControlStateNormal];
    [self.addressButton setFrame:CGRectMake(40 * ScaleX, 135 * ScaleX, 295 * ScaleX, 30 * ScaleX)];
    [self.addressButton setTitleColor:[UIColor colorWithWhite:0.417 alpha:1.000] forState:UIControlStateNormal];
    self.addressButton.layer.borderWidth = 0.3;
    self.addressButton.layer.borderColor = [UIColor colorWithWhite:0.451 alpha:1.000].CGColor;
    [self.addressButton setTitle:@"辽宁省大连市沙河口区数码广场10-3" forState:UIControlStateNormal];
    self.addressButton.layer.cornerRadius = 6;
    self.addressButton.layer.masksToBounds = YES;
    
}

-(void)call {
    NSURL *url = [NSURL URLWithString:@"tel://15214593480"];
    
    [[UIApplication sharedApplication] openURL:url];
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
